package com.yauthor.module.plugin
{
	import pl.ydp.utils.Ternary;
	
	
	/**
	 * Dispatched when the navigation availability of some item changed.
	 * Navigation plugin shoul dispatch this event using controller as
	 * source event
	 *
	 * @eventType pl.ydp.p2.modules.unit.UnitConstants.ITEM_AVAILABILITY_CHANGED
	 */
	[Event(name="itemAvailabilityChanged", type="flash.events.Event")]
	/**
	 * Assists test controller in navigation tasks.
	 */
	public interface INavigationPlugin 
	{	
		/**
		 * Check if navigation in given direction is available.
		 * @param direction direction description, possible values are:
		 * <ul>
		 * <li><b>"next", "prev", "previous"</b>:String - relative direction to current page
		 * <li><b>"first", "last"</b>:String - absolute position description
		 * <li><b>value that can be converted to number</b>:* - absolute page index
		 * <li><b>"#pageIdentifier"</b>:String - page identifier
		 * </ul>
		 * @return <ul>
		 * <li>Ternary.TRUE - navigation in this direction is allowed
		 * <li>Ternary.FALSE - navigation in this direction is disabled
		 * <li>Ternary.UNKNOWN - don't know - let default implemntation decide
		 * </ul>
		 */
		function isNavigationAvailable( direction:* ):Ternary;
		/**
		 * Performs navigation in given direction
		 * @param direction direction description, look at isNavigationAvailable
		 * @return <ul>
		 * <li>Ternary.TRUE - plugin perfomed navigation
		 * <li>Ternary.FALSE - navigation in this direction is disabled
		 * <li>Ternary.UNKNOWN - let default implemntation perform navigation
		 * </ul>
		 * @see #isNavigationAvailable()
		 */
		function navigate( direction:* ):Ternary;
	}
}